package com.system.controller;

import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.RequestMapping;
import com.background.service.IWebLinkService;
import com.system.util.ResposeRes;
import com.alibaba.fastjson.JSON;

@Controller
@RequestMapping("/webLink")
public class WebLinkController {
	
	@Autowired
	private IWebLinkService webLinkService;
	
	@RequestMapping("/getAllLinks")
	public ResposeRes<Set<String>> getAllLinks() {
		Set<String> links=webLinkService.getWebLinkFromCache();
		ResposeRes<Set<String>> res=new ResposeRes<Set<String>>(true,"OK");
		res.setContent(links);
	
//		String str=JSON.toJSONString(res);
//		System.out.println("---"+str);
		return res;	
	}
}
